#ifndef FOUNDATION_DATA_ACQ_TASK_H
#define FOUNDATION_DATA_ACQ_TASK_H
#include "dbms_channel.h"
#include <vendor_global.h>
#include <string>
#include <functional>
#include "channel_task.h"

namespace data_acq {
class DataAcqTask {
public:
	DataAcqTask(const std::string &name);
	~DataAcqTask() = default;
	void LoadProtocol(const std::string &filePath);
	void LoadChannels();
	void StartAll();
	void StopAll();
	void Subscribe(SubscribeCallback subscrib);
	void SubscribeException(SubscribeExceptionCallback subscribe);

	dbms::AcqData_t OnDeviceCommand(
		const std::string &, const std::vector<dbms::AcqItem_t> &);

	std::vector<uint8_t> OnDeviceCommand(
		int32_t channelId, const std::vector<uint8_t> &);

private:
	std::string name_;
	std::vector<std::shared_ptr<ChannelTask> > channelTasks_;
	SubscribeCallback subscribeCallback_ = nullptr;
	SubscribeExceptionCallback subscribeExceptionCallback_ = nullptr;
};
} // namespace data_acq
#endif